//
//  SocketObject.h
//  SocretTest
//
//  Created by ellenpage on 12-11-23.
//  Copyright (c) 2012年 ellenpage. All rights reserved.
//

#import "GCDAsyncSocket.h"
#import <Foundation/Foundation.h>

@protocol SocketDelegate <NSObject>

- (void)socketIsConnected;

- (void)socketIsDisConnected;

- (void)socketIsReadData:(NSData *)dataValue tag:(long)tagValue;

- (void)socketIsWriteData:(long)tagValue;

@end

@interface SocketObject : NSObject<SocketDelegate>

@property (assign, nonatomic) bool isServerOk;//每30s检测一次的标志位

@property (retain, nonatomic) NSString *lat;

@property (retain, nonatomic) NSString *lon;

@property (retain, nonatomic) id<SocketDelegate>delegate;

@property (retain, nonatomic) GCDAsyncSocket *gcdSocket;

+ (SocketObject *)sharedInstance;

- (void)startConnection;//建立连接

- (void)writeData:(NSData *)myData;//写数据

@end
